package com.dify.tool.common.enums;

import cn.hutool.core.util.ObjectUtil;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.ToString;

/**
 * DIFY APPID配置类
 *
 * @author cmd
 * @date 2025-06-03
 */
@Getter
@AllArgsConstructor
@ToString
public enum DifyAppEnum {


    RULE_SEARCH("ruleSearch", "规章制度智能体", "dbce2530-bd05-4dfb-a8ba-00a76307dd49"),
    CONTRACT_CHECK("contractCheck", "合同审查智能体", "5eae49eb-042a-44b2-812c-8ebb0cf2f9ac"),
    CONTRACT_GENERATE("contractGenerate", "合同生成智能体", "46e48119-df20-4c44-b4f4-5d3c93cbade1"),
    TECHNICAL_GENERATE("technicalGenerate", "技术方案生成智能体", "cb32dc1b-2e44-4dff-8c35-5f7fdf0c60d9");

    private String code;
    private String description;
    private String appId;

    public static String getAppIdByCode(String code) {
        for (DifyAppEnum d : DifyAppEnum.values()) {
            if (ObjectUtil.equal(d.getCode(), code)) {
                return d.getAppId();
            }
        }
        return null;
    }
}
